<script setup>
// 新增车辆
import { ref} from 'vue'
import { message } from 'ant-design-vue'

import {getTransportLineTripsByIdAPI} from '@/services/transportLine'
// 是否打开模态框-用于双向绑定
const props = defineProps(['open', 'id'])
const emit = defineEmits(['update:open', 'ok'])

// 表单组件实例
const formRef = ref()

// 表单字段
const formState = ref({
  departureTime:undefined,
  estimatedTime:undefined,
  name:undefined,
  id:props.id,
  period:undefined,
  periodName:undefined,
  transportLineId:undefined
})

const addCar =async()=>{
   const res=  await getTransportLineTripsByIdAPI(props.id)
   console.log(res)

 
}
addCar()







//下拉列表
const typeList=ref([
    {value:1,name:'天'},
    {value:2,name:'周'},
    {value:3,name:'月'},
])



</script>

<template>
  <a-modal
    :open="open"
    @update:open="emit('update:open', $event)"
    :title="'安排车辆'"
  
  >
    <a-form ref="formRef" :model="formState" :labelCol="{ span: 5 }">
      <a-form-item label="线路名称" name="number" required
       >
        <a-input v-model:value="name"  disabled/>
      </a-form-item>
      <a-form-item label="车次名称" name="name" required
       >
        <a-input v-model:value="name"   />
    
      </a-form-item>
      <a-form-item label="发车时间" name="departureTime" required 
      >
        <a-time-picker v-model:value="formState.departureTime" format="HH:mm" />
      </a-form-item>

      <a-form-item label="车辆安排" name="departureTime" required 
       :rules="[
          {
            message: '周期不能为空',
          },
        ]">
         <a-select v-model:value="formState.departureTime" >
        <a-select-option v-for="item in typeList" :key="item.value" :value="item.value" >{{item.name}}</a-select-option>
          </a-select>
      </a-form-item>
    </a-form>
  </a-modal>
</template>
